<?php
/**
* 订单会员
*
* @author chenping<chenping@shopex.cn>
* @version $Id: tax.php 2013-3-12 17:23Z
*/
class erpapi_shop_response_components_order_member extends erpapi_shop_response_components_order_abstract
{
    public function convert()
    {
        $member_info = $this->_platform->_ordersdf['member_info'];
        $shop_id     = $this->_platform->__channelObj->channel['shop_id'];

        unset($member_info['member_id']);
        if ($member_info) {
            $member_id = kernel::single('ome_member_func')->save($member_info,$shop_id);
            if ($member_id) {
                $this->_platform->_newOrder['member_id'] = $member_id;
                
                
            }
        }
    }
    
    public function update()
    {
        $member_info = $this->_platform->_ordersdf['member_info'];
        $shop_id     = $this->_platform->__channelObj->channel['shop_id'];

        unset($member_info['member_id']);

        if ($member_info) {
            $member_id = kernel::single('ome_member_func')->save(
                $member_info,
                $shop_id,
                $this->_platform->_tgOrder['member_id'],
                $old_member
                );

            if ($member_id != $this->_platform->_tgOrder['member_id']) {
                $this->_platform->_newOrder['member_id'] = $member_id;
            }
        }
    }
}